<?php
	/**
	 * This is a MetaControl class, providing a QForm or QPanel access to event handlers
	 * and QControls to perform the Create, Edit, and Delete functionality
	 * of the TableTransaction class.  This code-generated class
	 * contains all the basic elements to help a QPanel or QForm display an HTML form that can
	 * manipulate a single TableTransaction object.
	 *
	 * To take advantage of some (or all) of these control objects, you
	 * must create a new QForm or QPanel which instantiates a TableTransactionMetaControl
	 * class.
	 *
	 * Any and all changes to this file will be overwritten with any subsequent
	 * code re-generation.
	 * 
	 * @package My Application
	 * @subpackage MetaControls
	 * property-read TableTransaction $TableTransaction the actual TableTransaction data class being edited
	 * property QLabel $IdControl
	 * property-read QLabel $IdLabel
	 * property QListBox $UserIdControl
	 * property-read QLabel $UserIdLabel
	 * property QListBox $ProjectIdControl
	 * property-read QLabel $ProjectIdLabel
	 * property QListBox $BuyItemIdControl
	 * property-read QLabel $BuyItemIdLabel
	 * property QListBox $PointInIdControl
	 * property-read QLabel $PointInIdLabel
	 * property QListBox $PointOutIdControl
	 * property-read QLabel $PointOutIdLabel
	 * property QListBox $EscrowIdControl
	 * property-read QLabel $EscrowIdLabel
	 * property QIntegerTextBox $CurrencyControl
	 * property-read QLabel $CurrencyLabel
	 * property QIntegerTextBox $BalanceBeforeControl
	 * property-read QLabel $BalanceBeforeLabel
	 * property QIntegerTextBox $BalanceAfterControl
	 * property-read QLabel $BalanceAfterLabel
	 * property QIntegerTextBox $AmountControl
	 * property-read QLabel $AmountLabel
	 * property QDateTimePicker $TransactionDateControl
	 * property-read QLabel $TransactionDateLabel
	 * property QIntegerTextBox $TypeControl
	 * property-read QLabel $TypeLabel
	 * property QTextBox $DescriptionControl
	 * property-read QLabel $DescriptionLabel
	 * property QTextBox $ActiveControl
	 * property-read QLabel $ActiveLabel
	 * property QTextBox $IpControl
	 * property-read QLabel $IpLabel
	 * property-read string $TitleVerb a verb indicating whether or not this is being edited or created
	 * property-read boolean $EditMode a boolean indicating whether or not this is being edited or created
	 */

	class TableTransactionMetaControlGen extends QBaseClass {
		// General Variables
		protected $objTableTransaction;
		protected $objParentObject;
		protected $strTitleVerb;
		protected $blnEditMode;

		// Controls that allow the editing of TableTransaction's individual data fields
		protected $lblId;
		protected $lstUser;
		protected $lstProject;
		protected $lstBuyItem;
		protected $lstPointIn;
		protected $lstPointOut;
		protected $lstEscrow;
		protected $txtCurrency;
		protected $txtBalanceBefore;
		protected $txtBalanceAfter;
		protected $txtAmount;
		protected $calTransactionDate;
		protected $txtType;
		protected $txtDescription;
		protected $txtActive;
		protected $txtIp;

		// Controls that allow the viewing of TableTransaction's individual data fields
		protected $lblUserId;
		protected $lblProjectId;
		protected $lblBuyItemId;
		protected $lblPointInId;
		protected $lblPointOutId;
		protected $lblEscrowId;
		protected $lblCurrency;
		protected $lblBalanceBefore;
		protected $lblBalanceAfter;
		protected $lblAmount;
		protected $lblTransactionDate;
		protected $lblType;
		protected $lblDescription;
		protected $lblActive;
		protected $lblIp;

		// QListBox Controls (if applicable) to edit Unique ReverseReferences and ManyToMany References

		// QLabel Controls (if applicable) to view Unique ReverseReferences and ManyToMany References


		/**
		 * Main constructor.  Constructor OR static create methods are designed to be called in either
		 * a parent QPanel or the main QForm when wanting to create a
		 * TableTransactionMetaControl to edit a single TableTransaction object within the
		 * QPanel or QForm.
		 *
		 * This constructor takes in a single TableTransaction object, while any of the static
		 * create methods below can be used to construct based off of individual PK ID(s).
		 *
		 * @param mixed $objParentObject QForm or QPanel which will be using this TableTransactionMetaControl
		 * @param TableTransaction $objTableTransaction new or existing TableTransaction object
		 */
		 public function __construct($objParentObject, TableTransaction $objTableTransaction) {
			// Setup Parent Object (e.g. QForm or QPanel which will be using this TableTransactionMetaControl)
			$this->objParentObject = $objParentObject;

			// Setup linked TableTransaction object
			$this->objTableTransaction = $objTableTransaction;

			// Figure out if we're Editing or Creating New
			if ($this->objTableTransaction->__Restored) {
				$this->strTitleVerb = QApplication::Translate('Edit');
				$this->blnEditMode = true;
			} else {
				$this->strTitleVerb = QApplication::Translate('Create');
				$this->blnEditMode = false;
			}
		 }

		/**
		 * Static Helper Method to Create using PK arguments
		 * You must pass in the PK arguments on an object to load, or leave it blank to create a new one.
		 * If you want to load via QueryString or PathInfo, use the CreateFromQueryString or CreateFromPathInfo
		 * static helper methods.  Finally, specify a CreateType to define whether or not we are only allowed to 
		 * edit, or if we are also allowed to create a new one, etc.
		 * 
		 * @param mixed $objParentObject QForm or QPanel which will be using this TableTransactionMetaControl
		 * @param integer $intId primary key value
		 * @param QMetaControlCreateType $intCreateType rules governing TableTransaction object creation - defaults to CreateOrEdit
 		 * @return TableTransactionMetaControl
		 */
		public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
			// Attempt to Load from PK Arguments
			if (strlen($intId)) {
				$objTableTransaction = TableTransaction::Load($intId);

				// TableTransaction was found -- return it!
				if ($objTableTransaction)
					return new TableTransactionMetaControl($objParentObject, $objTableTransaction);

				// If CreateOnRecordNotFound not specified, throw an exception
				else if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound)
					throw new QCallerException('Could not find a TableTransaction object with PK arguments: ' . $intId);

			// If EditOnly is specified, throw an exception
			} else if ($intCreateType == QMetaControlCreateType::EditOnly)
				throw new QCallerException('No PK arguments specified');

			// If we are here, then we need to create a new record
			return new TableTransactionMetaControl($objParentObject, new TableTransaction());
		}

		/**
		 * Static Helper Method to Create using PathInfo arguments
		 *
		 * @param mixed $objParentObject QForm or QPanel which will be using this TableTransactionMetaControl
		 * @param QMetaControlCreateType $intCreateType rules governing TableTransaction object creation - defaults to CreateOrEdit
		 * @return TableTransactionMetaControl
		 */
		public static function CreateFromPathInfo($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
			$intId = QApplication::PathInfo(0);
			return TableTransactionMetaControl::Create($objParentObject, $intId, $intCreateType);
		}

		/**
		 * Static Helper Method to Create using QueryString arguments
		 *
		 * @param mixed $objParentObject QForm or QPanel which will be using this TableTransactionMetaControl
		 * @param QMetaControlCreateType $intCreateType rules governing TableTransaction object creation - defaults to CreateOrEdit
		 * @return TableTransactionMetaControl
		 */
		public static function CreateFromQueryString($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
			$intId = QApplication::QueryString('intId');
			return TableTransactionMetaControl::Create($objParentObject, $intId, $intCreateType);
		}



		///////////////////////////////////////////////
		// PUBLIC CREATE and REFRESH METHODS
		///////////////////////////////////////////////

		/**
		 * Create and setup QLabel lblId
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblId_Create($strControlId = null) {
			$this->lblId = new QLabel($this->objParentObject, $strControlId);
			$this->lblId->Name = QApplication::Translate('Id');
			if ($this->blnEditMode)
				$this->lblId->Text = $this->objTableTransaction->Id;
			else
				$this->lblId->Text = 'N/A';
			return $this->lblId;
		}

		/**
		 * Create and setup QListBox lstUser
		 * @param string $strControlId optional ControlId to use
		 * @return QListBox
		 */
		public function lstUser_Create($strControlId = null) {
			$this->lstUser = new QListBox($this->objParentObject, $strControlId);
			$this->lstUser->Name = QApplication::Translate('User');
			$this->lstUser->Required = true;
			if (!$this->blnEditMode)
				$this->lstUser->AddItem(QApplication::Translate('- Select One -'), null);
			$objUserArray = TableUserProject::LoadAll();
			if ($objUserArray) foreach ($objUserArray as $objUser) {
				$objListItem = new QListItem($objUser->__toString(), $objUser->Id);
				if (($this->objTableTransaction->User) && ($this->objTableTransaction->User->Id == $objUser->Id))
					$objListItem->Selected = true;
				$this->lstUser->AddItem($objListItem);
			}
			return $this->lstUser;
		}

		/**
		 * Create and setup QLabel lblUserId
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblUserId_Create($strControlId = null) {
			$this->lblUserId = new QLabel($this->objParentObject, $strControlId);
			$this->lblUserId->Name = QApplication::Translate('User');
			$this->lblUserId->Text = ($this->objTableTransaction->User) ? $this->objTableTransaction->User->__toString() : null;
			$this->lblUserId->Required = true;
			return $this->lblUserId;
		}

		/**
		 * Create and setup QListBox lstProject
		 * @param string $strControlId optional ControlId to use
		 * @return QListBox
		 */
		public function lstProject_Create($strControlId = null) {
			$this->lstProject = new QListBox($this->objParentObject, $strControlId);
			$this->lstProject->Name = QApplication::Translate('Project');
			$this->lstProject->AddItem(QApplication::Translate('- Select One -'), null);
			$objProjectArray = TableProject::LoadAll();
			if ($objProjectArray) foreach ($objProjectArray as $objProject) {
				$objListItem = new QListItem($objProject->__toString(), $objProject->Id);
				if (($this->objTableTransaction->Project) && ($this->objTableTransaction->Project->Id == $objProject->Id))
					$objListItem->Selected = true;
				$this->lstProject->AddItem($objListItem);
			}
			return $this->lstProject;
		}

		/**
		 * Create and setup QLabel lblProjectId
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblProjectId_Create($strControlId = null) {
			$this->lblProjectId = new QLabel($this->objParentObject, $strControlId);
			$this->lblProjectId->Name = QApplication::Translate('Project');
			$this->lblProjectId->Text = ($this->objTableTransaction->Project) ? $this->objTableTransaction->Project->__toString() : null;
			return $this->lblProjectId;
		}

		/**
		 * Create and setup QListBox lstBuyItem
		 * @param string $strControlId optional ControlId to use
		 * @return QListBox
		 */
		public function lstBuyItem_Create($strControlId = null) {
			$this->lstBuyItem = new QListBox($this->objParentObject, $strControlId);
			$this->lstBuyItem->Name = QApplication::Translate('Buy Item');
			$this->lstBuyItem->AddItem(QApplication::Translate('- Select One -'), null);
			$objBuyItemArray = TableItemGet::LoadAll();
			if ($objBuyItemArray) foreach ($objBuyItemArray as $objBuyItem) {
				$objListItem = new QListItem($objBuyItem->__toString(), $objBuyItem->Id);
				if (($this->objTableTransaction->BuyItem) && ($this->objTableTransaction->BuyItem->Id == $objBuyItem->Id))
					$objListItem->Selected = true;
				$this->lstBuyItem->AddItem($objListItem);
			}
			return $this->lstBuyItem;
		}

		/**
		 * Create and setup QLabel lblBuyItemId
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblBuyItemId_Create($strControlId = null) {
			$this->lblBuyItemId = new QLabel($this->objParentObject, $strControlId);
			$this->lblBuyItemId->Name = QApplication::Translate('Buy Item');
			$this->lblBuyItemId->Text = ($this->objTableTransaction->BuyItem) ? $this->objTableTransaction->BuyItem->__toString() : null;
			return $this->lblBuyItemId;
		}

		/**
		 * Create and setup QListBox lstPointIn
		 * @param string $strControlId optional ControlId to use
		 * @return QListBox
		 */
		public function lstPointIn_Create($strControlId = null) {
			$this->lstPointIn = new QListBox($this->objParentObject, $strControlId);
			$this->lstPointIn->Name = QApplication::Translate('Point In');
			$this->lstPointIn->AddItem(QApplication::Translate('- Select One -'), null);
			$objPointInArray = TablePointIn::LoadAll();
			if ($objPointInArray) foreach ($objPointInArray as $objPointIn) {
				$objListItem = new QListItem($objPointIn->__toString(), $objPointIn->Id);
				if (($this->objTableTransaction->PointIn) && ($this->objTableTransaction->PointIn->Id == $objPointIn->Id))
					$objListItem->Selected = true;
				$this->lstPointIn->AddItem($objListItem);
			}
			return $this->lstPointIn;
		}

		/**
		 * Create and setup QLabel lblPointInId
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblPointInId_Create($strControlId = null) {
			$this->lblPointInId = new QLabel($this->objParentObject, $strControlId);
			$this->lblPointInId->Name = QApplication::Translate('Point In');
			$this->lblPointInId->Text = ($this->objTableTransaction->PointIn) ? $this->objTableTransaction->PointIn->__toString() : null;
			return $this->lblPointInId;
		}

		/**
		 * Create and setup QListBox lstPointOut
		 * @param string $strControlId optional ControlId to use
		 * @return QListBox
		 */
		public function lstPointOut_Create($strControlId = null) {
			$this->lstPointOut = new QListBox($this->objParentObject, $strControlId);
			$this->lstPointOut->Name = QApplication::Translate('Point Out');
			$this->lstPointOut->AddItem(QApplication::Translate('- Select One -'), null);
			$objPointOutArray = TablePointOut::LoadAll();
			if ($objPointOutArray) foreach ($objPointOutArray as $objPointOut) {
				$objListItem = new QListItem($objPointOut->__toString(), $objPointOut->Id);
				if (($this->objTableTransaction->PointOut) && ($this->objTableTransaction->PointOut->Id == $objPointOut->Id))
					$objListItem->Selected = true;
				$this->lstPointOut->AddItem($objListItem);
			}
			return $this->lstPointOut;
		}

		/**
		 * Create and setup QLabel lblPointOutId
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblPointOutId_Create($strControlId = null) {
			$this->lblPointOutId = new QLabel($this->objParentObject, $strControlId);
			$this->lblPointOutId->Name = QApplication::Translate('Point Out');
			$this->lblPointOutId->Text = ($this->objTableTransaction->PointOut) ? $this->objTableTransaction->PointOut->__toString() : null;
			return $this->lblPointOutId;
		}

		/**
		 * Create and setup QListBox lstEscrow
		 * @param string $strControlId optional ControlId to use
		 * @return QListBox
		 */
		public function lstEscrow_Create($strControlId = null) {
			$this->lstEscrow = new QListBox($this->objParentObject, $strControlId);
			$this->lstEscrow->Name = QApplication::Translate('Escrow');
			$this->lstEscrow->AddItem(QApplication::Translate('- Select One -'), null);
			$objEscrowArray = TableEscrow::LoadAll();
			if ($objEscrowArray) foreach ($objEscrowArray as $objEscrow) {
				$objListItem = new QListItem($objEscrow->__toString(), $objEscrow->Id);
				if (($this->objTableTransaction->Escrow) && ($this->objTableTransaction->Escrow->Id == $objEscrow->Id))
					$objListItem->Selected = true;
				$this->lstEscrow->AddItem($objListItem);
			}
			return $this->lstEscrow;
		}

		/**
		 * Create and setup QLabel lblEscrowId
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblEscrowId_Create($strControlId = null) {
			$this->lblEscrowId = new QLabel($this->objParentObject, $strControlId);
			$this->lblEscrowId->Name = QApplication::Translate('Escrow');
			$this->lblEscrowId->Text = ($this->objTableTransaction->Escrow) ? $this->objTableTransaction->Escrow->__toString() : null;
			return $this->lblEscrowId;
		}

		/**
		 * Create and setup QIntegerTextBox txtCurrency
		 * @param string $strControlId optional ControlId to use
		 * @return QIntegerTextBox
		 */
		public function txtCurrency_Create($strControlId = null) {
			$this->txtCurrency = new QIntegerTextBox($this->objParentObject, $strControlId);
			$this->txtCurrency->Name = QApplication::Translate('Currency');
			$this->txtCurrency->Text = $this->objTableTransaction->Currency;
			return $this->txtCurrency;
		}

		/**
		 * Create and setup QLabel lblCurrency
		 * @param string $strControlId optional ControlId to use
		 * @param string $strFormat optional sprintf format to use
		 * @return QLabel
		 */
		public function lblCurrency_Create($strControlId = null, $strFormat = null) {
			$this->lblCurrency = new QLabel($this->objParentObject, $strControlId);
			$this->lblCurrency->Name = QApplication::Translate('Currency');
			$this->lblCurrency->Text = $this->objTableTransaction->Currency;
			$this->lblCurrency->Format = $strFormat;
			return $this->lblCurrency;
		}

		/**
		 * Create and setup QIntegerTextBox txtBalanceBefore
		 * @param string $strControlId optional ControlId to use
		 * @return QIntegerTextBox
		 */
		public function txtBalanceBefore_Create($strControlId = null) {
			$this->txtBalanceBefore = new QIntegerTextBox($this->objParentObject, $strControlId);
			$this->txtBalanceBefore->Name = QApplication::Translate('Balance Before');
			$this->txtBalanceBefore->Text = $this->objTableTransaction->BalanceBefore;
			return $this->txtBalanceBefore;
		}

		/**
		 * Create and setup QLabel lblBalanceBefore
		 * @param string $strControlId optional ControlId to use
		 * @param string $strFormat optional sprintf format to use
		 * @return QLabel
		 */
		public function lblBalanceBefore_Create($strControlId = null, $strFormat = null) {
			$this->lblBalanceBefore = new QLabel($this->objParentObject, $strControlId);
			$this->lblBalanceBefore->Name = QApplication::Translate('Balance Before');
			$this->lblBalanceBefore->Text = $this->objTableTransaction->BalanceBefore;
			$this->lblBalanceBefore->Format = $strFormat;
			return $this->lblBalanceBefore;
		}

		/**
		 * Create and setup QIntegerTextBox txtBalanceAfter
		 * @param string $strControlId optional ControlId to use
		 * @return QIntegerTextBox
		 */
		public function txtBalanceAfter_Create($strControlId = null) {
			$this->txtBalanceAfter = new QIntegerTextBox($this->objParentObject, $strControlId);
			$this->txtBalanceAfter->Name = QApplication::Translate('Balance After');
			$this->txtBalanceAfter->Text = $this->objTableTransaction->BalanceAfter;
			return $this->txtBalanceAfter;
		}

		/**
		 * Create and setup QLabel lblBalanceAfter
		 * @param string $strControlId optional ControlId to use
		 * @param string $strFormat optional sprintf format to use
		 * @return QLabel
		 */
		public function lblBalanceAfter_Create($strControlId = null, $strFormat = null) {
			$this->lblBalanceAfter = new QLabel($this->objParentObject, $strControlId);
			$this->lblBalanceAfter->Name = QApplication::Translate('Balance After');
			$this->lblBalanceAfter->Text = $this->objTableTransaction->BalanceAfter;
			$this->lblBalanceAfter->Format = $strFormat;
			return $this->lblBalanceAfter;
		}

		/**
		 * Create and setup QIntegerTextBox txtAmount
		 * @param string $strControlId optional ControlId to use
		 * @return QIntegerTextBox
		 */
		public function txtAmount_Create($strControlId = null) {
			$this->txtAmount = new QIntegerTextBox($this->objParentObject, $strControlId);
			$this->txtAmount->Name = QApplication::Translate('Amount');
			$this->txtAmount->Text = $this->objTableTransaction->Amount;
			return $this->txtAmount;
		}

		/**
		 * Create and setup QLabel lblAmount
		 * @param string $strControlId optional ControlId to use
		 * @param string $strFormat optional sprintf format to use
		 * @return QLabel
		 */
		public function lblAmount_Create($strControlId = null, $strFormat = null) {
			$this->lblAmount = new QLabel($this->objParentObject, $strControlId);
			$this->lblAmount->Name = QApplication::Translate('Amount');
			$this->lblAmount->Text = $this->objTableTransaction->Amount;
			$this->lblAmount->Format = $strFormat;
			return $this->lblAmount;
		}

		/**
		 * Create and setup QDateTimePicker calTransactionDate
		 * @param string $strControlId optional ControlId to use
		 * @return QDateTimePicker
		 */
		public function calTransactionDate_Create($strControlId = null) {
			$this->calTransactionDate = new QDateTimePicker($this->objParentObject, $strControlId);
			$this->calTransactionDate->Name = QApplication::Translate('Transaction Date');
			$this->calTransactionDate->DateTime = $this->objTableTransaction->TransactionDate;
			$this->calTransactionDate->DateTimePickerType = QDateTimePickerType::DateTime;
			return $this->calTransactionDate;
		}

		/**
		 * Create and setup QLabel lblTransactionDate
		 * @param string $strControlId optional ControlId to use
		 * @param string $strDateTimeFormat optional DateTimeFormat to use
		 * @return QLabel
		 */
		public function lblTransactionDate_Create($strControlId = null, $strDateTimeFormat = null) {
			$this->lblTransactionDate = new QLabel($this->objParentObject, $strControlId);
			$this->lblTransactionDate->Name = QApplication::Translate('Transaction Date');
			$this->strTransactionDateDateTimeFormat = $strDateTimeFormat;
			$this->lblTransactionDate->Text = sprintf($this->objTableTransaction->TransactionDate) ? $this->objTableTransaction->TransactionDate->__toString($this->strTransactionDateDateTimeFormat) : null;
			return $this->lblTransactionDate;
		}

		protected $strTransactionDateDateTimeFormat;


		/**
		 * Create and setup QIntegerTextBox txtType
		 * @param string $strControlId optional ControlId to use
		 * @return QIntegerTextBox
		 */
		public function txtType_Create($strControlId = null) {
			$this->txtType = new QIntegerTextBox($this->objParentObject, $strControlId);
			$this->txtType->Name = QApplication::Translate('Type');
			$this->txtType->Text = $this->objTableTransaction->Type;
			$this->txtType->Required = true;
			return $this->txtType;
		}

		/**
		 * Create and setup QLabel lblType
		 * @param string $strControlId optional ControlId to use
		 * @param string $strFormat optional sprintf format to use
		 * @return QLabel
		 */
		public function lblType_Create($strControlId = null, $strFormat = null) {
			$this->lblType = new QLabel($this->objParentObject, $strControlId);
			$this->lblType->Name = QApplication::Translate('Type');
			$this->lblType->Text = $this->objTableTransaction->Type;
			$this->lblType->Required = true;
			$this->lblType->Format = $strFormat;
			return $this->lblType;
		}

		/**
		 * Create and setup QTextBox txtDescription
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtDescription_Create($strControlId = null) {
			$this->txtDescription = new QTextBox($this->objParentObject, $strControlId);
			$this->txtDescription->Name = QApplication::Translate('Description');
			$this->txtDescription->Text = $this->objTableTransaction->Description;
			$this->txtDescription->Required = true;
			$this->txtDescription->MaxLength = TableTransaction::DescriptionMaxLength;
			return $this->txtDescription;
		}

		/**
		 * Create and setup QLabel lblDescription
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblDescription_Create($strControlId = null) {
			$this->lblDescription = new QLabel($this->objParentObject, $strControlId);
			$this->lblDescription->Name = QApplication::Translate('Description');
			$this->lblDescription->Text = $this->objTableTransaction->Description;
			$this->lblDescription->Required = true;
			return $this->lblDescription;
		}

		/**
		 * Create and setup QTextBox txtActive
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtActive_Create($strControlId = null) {
			$this->txtActive = new QTextBox($this->objParentObject, $strControlId);
			$this->txtActive->Name = QApplication::Translate('Active');
			$this->txtActive->Text = $this->objTableTransaction->Active;
			$this->txtActive->Required = true;
			$this->txtActive->MaxLength = TableTransaction::ActiveMaxLength;
			return $this->txtActive;
		}

		/**
		 * Create and setup QLabel lblActive
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblActive_Create($strControlId = null) {
			$this->lblActive = new QLabel($this->objParentObject, $strControlId);
			$this->lblActive->Name = QApplication::Translate('Active');
			$this->lblActive->Text = $this->objTableTransaction->Active;
			$this->lblActive->Required = true;
			return $this->lblActive;
		}

		/**
		 * Create and setup QTextBox txtIp
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtIp_Create($strControlId = null) {
			$this->txtIp = new QTextBox($this->objParentObject, $strControlId);
			$this->txtIp->Name = QApplication::Translate('Ip');
			$this->txtIp->Text = $this->objTableTransaction->Ip;
			$this->txtIp->MaxLength = TableTransaction::IpMaxLength;
			return $this->txtIp;
		}

		/**
		 * Create and setup QLabel lblIp
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblIp_Create($strControlId = null) {
			$this->lblIp = new QLabel($this->objParentObject, $strControlId);
			$this->lblIp->Name = QApplication::Translate('Ip');
			$this->lblIp->Text = $this->objTableTransaction->Ip;
			return $this->lblIp;
		}



		/**
		 * Refresh this MetaControl with Data from the local TableTransaction object.
		 * @param boolean $blnReload reload TableTransaction from the database
		 * @return void
		 */
		public function Refresh($blnReload = false) {
			if ($blnReload)
				$this->objTableTransaction->Reload();

			if ($this->lblId) if ($this->blnEditMode) $this->lblId->Text = $this->objTableTransaction->Id;

			if ($this->lstUser) {
					$this->lstUser->RemoveAllItems();
				if (!$this->blnEditMode)
					$this->lstUser->AddItem(QApplication::Translate('- Select One -'), null);
				$objUserArray = TableUserProject::LoadAll();
				if ($objUserArray) foreach ($objUserArray as $objUser) {
					$objListItem = new QListItem($objUser->__toString(), $objUser->Id);
					if (($this->objTableTransaction->User) && ($this->objTableTransaction->User->Id == $objUser->Id))
						$objListItem->Selected = true;
					$this->lstUser->AddItem($objListItem);
				}
			}
			if ($this->lblUserId) $this->lblUserId->Text = ($this->objTableTransaction->User) ? $this->objTableTransaction->User->__toString() : null;

			if ($this->lstProject) {
					$this->lstProject->RemoveAllItems();
				$this->lstProject->AddItem(QApplication::Translate('- Select One -'), null);
				$objProjectArray = TableProject::LoadAll();
				if ($objProjectArray) foreach ($objProjectArray as $objProject) {
					$objListItem = new QListItem($objProject->__toString(), $objProject->Id);
					if (($this->objTableTransaction->Project) && ($this->objTableTransaction->Project->Id == $objProject->Id))
						$objListItem->Selected = true;
					$this->lstProject->AddItem($objListItem);
				}
			}
			if ($this->lblProjectId) $this->lblProjectId->Text = ($this->objTableTransaction->Project) ? $this->objTableTransaction->Project->__toString() : null;

			if ($this->lstBuyItem) {
					$this->lstBuyItem->RemoveAllItems();
				$this->lstBuyItem->AddItem(QApplication::Translate('- Select One -'), null);
				$objBuyItemArray = TableItemGet::LoadAll();
				if ($objBuyItemArray) foreach ($objBuyItemArray as $objBuyItem) {
					$objListItem = new QListItem($objBuyItem->__toString(), $objBuyItem->Id);
					if (($this->objTableTransaction->BuyItem) && ($this->objTableTransaction->BuyItem->Id == $objBuyItem->Id))
						$objListItem->Selected = true;
					$this->lstBuyItem->AddItem($objListItem);
				}
			}
			if ($this->lblBuyItemId) $this->lblBuyItemId->Text = ($this->objTableTransaction->BuyItem) ? $this->objTableTransaction->BuyItem->__toString() : null;

			if ($this->lstPointIn) {
					$this->lstPointIn->RemoveAllItems();
				$this->lstPointIn->AddItem(QApplication::Translate('- Select One -'), null);
				$objPointInArray = TablePointIn::LoadAll();
				if ($objPointInArray) foreach ($objPointInArray as $objPointIn) {
					$objListItem = new QListItem($objPointIn->__toString(), $objPointIn->Id);
					if (($this->objTableTransaction->PointIn) && ($this->objTableTransaction->PointIn->Id == $objPointIn->Id))
						$objListItem->Selected = true;
					$this->lstPointIn->AddItem($objListItem);
				}
			}
			if ($this->lblPointInId) $this->lblPointInId->Text = ($this->objTableTransaction->PointIn) ? $this->objTableTransaction->PointIn->__toString() : null;

			if ($this->lstPointOut) {
					$this->lstPointOut->RemoveAllItems();
				$this->lstPointOut->AddItem(QApplication::Translate('- Select One -'), null);
				$objPointOutArray = TablePointOut::LoadAll();
				if ($objPointOutArray) foreach ($objPointOutArray as $objPointOut) {
					$objListItem = new QListItem($objPointOut->__toString(), $objPointOut->Id);
					if (($this->objTableTransaction->PointOut) && ($this->objTableTransaction->PointOut->Id == $objPointOut->Id))
						$objListItem->Selected = true;
					$this->lstPointOut->AddItem($objListItem);
				}
			}
			if ($this->lblPointOutId) $this->lblPointOutId->Text = ($this->objTableTransaction->PointOut) ? $this->objTableTransaction->PointOut->__toString() : null;

			if ($this->lstEscrow) {
					$this->lstEscrow->RemoveAllItems();
				$this->lstEscrow->AddItem(QApplication::Translate('- Select One -'), null);
				$objEscrowArray = TableEscrow::LoadAll();
				if ($objEscrowArray) foreach ($objEscrowArray as $objEscrow) {
					$objListItem = new QListItem($objEscrow->__toString(), $objEscrow->Id);
					if (($this->objTableTransaction->Escrow) && ($this->objTableTransaction->Escrow->Id == $objEscrow->Id))
						$objListItem->Selected = true;
					$this->lstEscrow->AddItem($objListItem);
				}
			}
			if ($this->lblEscrowId) $this->lblEscrowId->Text = ($this->objTableTransaction->Escrow) ? $this->objTableTransaction->Escrow->__toString() : null;

			if ($this->txtCurrency) $this->txtCurrency->Text = $this->objTableTransaction->Currency;
			if ($this->lblCurrency) $this->lblCurrency->Text = $this->objTableTransaction->Currency;

			if ($this->txtBalanceBefore) $this->txtBalanceBefore->Text = $this->objTableTransaction->BalanceBefore;
			if ($this->lblBalanceBefore) $this->lblBalanceBefore->Text = $this->objTableTransaction->BalanceBefore;

			if ($this->txtBalanceAfter) $this->txtBalanceAfter->Text = $this->objTableTransaction->BalanceAfter;
			if ($this->lblBalanceAfter) $this->lblBalanceAfter->Text = $this->objTableTransaction->BalanceAfter;

			if ($this->txtAmount) $this->txtAmount->Text = $this->objTableTransaction->Amount;
			if ($this->lblAmount) $this->lblAmount->Text = $this->objTableTransaction->Amount;

			if ($this->calTransactionDate) $this->calTransactionDate->DateTime = $this->objTableTransaction->TransactionDate;
			if ($this->lblTransactionDate) $this->lblTransactionDate->Text = sprintf($this->objTableTransaction->TransactionDate) ? $this->objTableTransaction->TransactionDate->__toString($this->strTransactionDateDateTimeFormat) : null;

			if ($this->txtType) $this->txtType->Text = $this->objTableTransaction->Type;
			if ($this->lblType) $this->lblType->Text = $this->objTableTransaction->Type;

			if ($this->txtDescription) $this->txtDescription->Text = $this->objTableTransaction->Description;
			if ($this->lblDescription) $this->lblDescription->Text = $this->objTableTransaction->Description;

			if ($this->txtActive) $this->txtActive->Text = $this->objTableTransaction->Active;
			if ($this->lblActive) $this->lblActive->Text = $this->objTableTransaction->Active;

			if ($this->txtIp) $this->txtIp->Text = $this->objTableTransaction->Ip;
			if ($this->lblIp) $this->lblIp->Text = $this->objTableTransaction->Ip;

		}



		///////////////////////////////////////////////
		// PROTECTED UPDATE METHODS for ManyToManyReferences (if any)
		///////////////////////////////////////////////





		///////////////////////////////////////////////
		// PUBLIC TABLETRANSACTION OBJECT MANIPULATORS
		///////////////////////////////////////////////

		/**
		 * This will save this object's TableTransaction instance,
		 * updating only the fields which have had a control created for it.
		 */
		public function SaveTableTransaction() {
			try {
				// Update any fields for controls that have been created
				if ($this->lstUser) $this->objTableTransaction->UserId = $this->lstUser->SelectedValue;
				if ($this->lstProject) $this->objTableTransaction->ProjectId = $this->lstProject->SelectedValue;
				if ($this->lstBuyItem) $this->objTableTransaction->BuyItemId = $this->lstBuyItem->SelectedValue;
				if ($this->lstPointIn) $this->objTableTransaction->PointInId = $this->lstPointIn->SelectedValue;
				if ($this->lstPointOut) $this->objTableTransaction->PointOutId = $this->lstPointOut->SelectedValue;
				if ($this->lstEscrow) $this->objTableTransaction->EscrowId = $this->lstEscrow->SelectedValue;
				if ($this->txtCurrency) $this->objTableTransaction->Currency = $this->txtCurrency->Text;
				if ($this->txtBalanceBefore) $this->objTableTransaction->BalanceBefore = $this->txtBalanceBefore->Text;
				if ($this->txtBalanceAfter) $this->objTableTransaction->BalanceAfter = $this->txtBalanceAfter->Text;
				if ($this->txtAmount) $this->objTableTransaction->Amount = $this->txtAmount->Text;
				if ($this->calTransactionDate) $this->objTableTransaction->TransactionDate = $this->calTransactionDate->DateTime;
				if ($this->txtType) $this->objTableTransaction->Type = $this->txtType->Text;
				if ($this->txtDescription) $this->objTableTransaction->Description = $this->txtDescription->Text;
				if ($this->txtActive) $this->objTableTransaction->Active = $this->txtActive->Text;
				if ($this->txtIp) $this->objTableTransaction->Ip = $this->txtIp->Text;

				// Update any UniqueReverseReferences (if any) for controls that have been created for it

				// Save the TableTransaction object
				$this->objTableTransaction->Save();

				// Finally, update any ManyToManyReferences (if any)
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * This will DELETE this object's TableTransaction instance from the database.
		 * It will also unassociate itself from any ManyToManyReferences.
		 */
		public function DeleteTableTransaction() {
			$this->objTableTransaction->Delete();
		}		



		///////////////////////////////////////////////
		// PUBLIC GETTERS and SETTERS
		///////////////////////////////////////////////

		/**
		 * Override method to perform a property "Get"
		 * This will get the value of $strName
		 *
		 * @param string $strName Name of the property to get
		 * @return mixed
		 */
		public function __get($strName) {
			switch ($strName) {
				// General MetaControlVariables
				case 'TableTransaction': return $this->objTableTransaction;
				case 'TitleVerb': return $this->strTitleVerb;
				case 'EditMode': return $this->blnEditMode;

				// Controls that point to TableTransaction fields -- will be created dynamically if not yet created
				case 'IdControl':
					if (!$this->lblId) return $this->lblId_Create();
					return $this->lblId;
				case 'IdLabel':
					if (!$this->lblId) return $this->lblId_Create();
					return $this->lblId;
				case 'UserIdControl':
					if (!$this->lstUser) return $this->lstUser_Create();
					return $this->lstUser;
				case 'UserIdLabel':
					if (!$this->lblUserId) return $this->lblUserId_Create();
					return $this->lblUserId;
				case 'ProjectIdControl':
					if (!$this->lstProject) return $this->lstProject_Create();
					return $this->lstProject;
				case 'ProjectIdLabel':
					if (!$this->lblProjectId) return $this->lblProjectId_Create();
					return $this->lblProjectId;
				case 'BuyItemIdControl':
					if (!$this->lstBuyItem) return $this->lstBuyItem_Create();
					return $this->lstBuyItem;
				case 'BuyItemIdLabel':
					if (!$this->lblBuyItemId) return $this->lblBuyItemId_Create();
					return $this->lblBuyItemId;
				case 'PointInIdControl':
					if (!$this->lstPointIn) return $this->lstPointIn_Create();
					return $this->lstPointIn;
				case 'PointInIdLabel':
					if (!$this->lblPointInId) return $this->lblPointInId_Create();
					return $this->lblPointInId;
				case 'PointOutIdControl':
					if (!$this->lstPointOut) return $this->lstPointOut_Create();
					return $this->lstPointOut;
				case 'PointOutIdLabel':
					if (!$this->lblPointOutId) return $this->lblPointOutId_Create();
					return $this->lblPointOutId;
				case 'EscrowIdControl':
					if (!$this->lstEscrow) return $this->lstEscrow_Create();
					return $this->lstEscrow;
				case 'EscrowIdLabel':
					if (!$this->lblEscrowId) return $this->lblEscrowId_Create();
					return $this->lblEscrowId;
				case 'CurrencyControl':
					if (!$this->txtCurrency) return $this->txtCurrency_Create();
					return $this->txtCurrency;
				case 'CurrencyLabel':
					if (!$this->lblCurrency) return $this->lblCurrency_Create();
					return $this->lblCurrency;
				case 'BalanceBeforeControl':
					if (!$this->txtBalanceBefore) return $this->txtBalanceBefore_Create();
					return $this->txtBalanceBefore;
				case 'BalanceBeforeLabel':
					if (!$this->lblBalanceBefore) return $this->lblBalanceBefore_Create();
					return $this->lblBalanceBefore;
				case 'BalanceAfterControl':
					if (!$this->txtBalanceAfter) return $this->txtBalanceAfter_Create();
					return $this->txtBalanceAfter;
				case 'BalanceAfterLabel':
					if (!$this->lblBalanceAfter) return $this->lblBalanceAfter_Create();
					return $this->lblBalanceAfter;
				case 'AmountControl':
					if (!$this->txtAmount) return $this->txtAmount_Create();
					return $this->txtAmount;
				case 'AmountLabel':
					if (!$this->lblAmount) return $this->lblAmount_Create();
					return $this->lblAmount;
				case 'TransactionDateControl':
					if (!$this->calTransactionDate) return $this->calTransactionDate_Create();
					return $this->calTransactionDate;
				case 'TransactionDateLabel':
					if (!$this->lblTransactionDate) return $this->lblTransactionDate_Create();
					return $this->lblTransactionDate;
				case 'TypeControl':
					if (!$this->txtType) return $this->txtType_Create();
					return $this->txtType;
				case 'TypeLabel':
					if (!$this->lblType) return $this->lblType_Create();
					return $this->lblType;
				case 'DescriptionControl':
					if (!$this->txtDescription) return $this->txtDescription_Create();
					return $this->txtDescription;
				case 'DescriptionLabel':
					if (!$this->lblDescription) return $this->lblDescription_Create();
					return $this->lblDescription;
				case 'ActiveControl':
					if (!$this->txtActive) return $this->txtActive_Create();
					return $this->txtActive;
				case 'ActiveLabel':
					if (!$this->lblActive) return $this->lblActive_Create();
					return $this->lblActive;
				case 'IpControl':
					if (!$this->txtIp) return $this->txtIp_Create();
					return $this->txtIp;
				case 'IpLabel':
					if (!$this->lblIp) return $this->lblIp_Create();
					return $this->lblIp;
				default:
					try {
						return parent::__get($strName);
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}
			}
		}

		/**
		 * Override method to perform a property "Set"
		 * This will set the property $strName to be $mixValue
		 *
		 * @param string $strName Name of the property to set
		 * @param string $mixValue New value of the property
		 * @return mixed
		 */
		public function __set($strName, $mixValue) {
			try {
				switch ($strName) {
					// Controls that point to TableTransaction fields
					case 'IdControl':
						return ($this->lblId = QType::Cast($mixValue, 'QControl'));
					case 'UserIdControl':
						return ($this->lstUser = QType::Cast($mixValue, 'QControl'));
					case 'ProjectIdControl':
						return ($this->lstProject = QType::Cast($mixValue, 'QControl'));
					case 'BuyItemIdControl':
						return ($this->lstBuyItem = QType::Cast($mixValue, 'QControl'));
					case 'PointInIdControl':
						return ($this->lstPointIn = QType::Cast($mixValue, 'QControl'));
					case 'PointOutIdControl':
						return ($this->lstPointOut = QType::Cast($mixValue, 'QControl'));
					case 'EscrowIdControl':
						return ($this->lstEscrow = QType::Cast($mixValue, 'QControl'));
					case 'CurrencyControl':
						return ($this->txtCurrency = QType::Cast($mixValue, 'QControl'));
					case 'BalanceBeforeControl':
						return ($this->txtBalanceBefore = QType::Cast($mixValue, 'QControl'));
					case 'BalanceAfterControl':
						return ($this->txtBalanceAfter = QType::Cast($mixValue, 'QControl'));
					case 'AmountControl':
						return ($this->txtAmount = QType::Cast($mixValue, 'QControl'));
					case 'TransactionDateControl':
						return ($this->calTransactionDate = QType::Cast($mixValue, 'QControl'));
					case 'TypeControl':
						return ($this->txtType = QType::Cast($mixValue, 'QControl'));
					case 'DescriptionControl':
						return ($this->txtDescription = QType::Cast($mixValue, 'QControl'));
					case 'ActiveControl':
						return ($this->txtActive = QType::Cast($mixValue, 'QControl'));
					case 'IpControl':
						return ($this->txtIp = QType::Cast($mixValue, 'QControl'));
					default:
						return parent::__set($strName, $mixValue);
				}
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}
	}
?>